package com.mars.btrace.demo;

import com.sun.btrace.AnyType;
import com.sun.btrace.BTraceUtils;
import com.sun.btrace.annotations.*;

/**
 * author by: mars
 * Date: 2019/5/25 22:56
 * Description: 拦截返回值
 */
@BTrace
public class BtraceDemo4 {

    @OnMethod(
            clazz = "com.mars.btrace.controller.UserController",
            method = "getUsername",
            location=@Location(Kind.RETURN)
    )
    public static void getUsername(@ProbeClassName String pcn, @ProbeMethodName String pmn,@Return AnyType result){
        BTraceUtils.println(pcn+","+pmn);
        BTraceUtils.println(result);
        BTraceUtils.println(result);
    }
}
